<template>
  <div class="verify-page">
    <!-- 添加粒子背景 -->
    <div class="particles-container">
      <div v-for="n in 20" :key="n" class="particle" :style="{ 
        '--delay': `${Math.random() * 5}s`,
        '--duration': `${Math.random() * 10 + 10}s`,
        '--position': `${Math.random() * 100}%`,
        '--size': `${Math.random() * 30 + 10}px`
      }"></div>
    </div>
    
    <div class="page-title-section">
      <div class="magical-underline"></div>
      <h1 class="magical-title">学信链证书验证系统</h1>
      <div class="title-decoration left"></div>
      <div class="title-decoration right"></div>
    </div>

    <!-- 添加验证流程指引 -->
    <div class="verify-process-guide">
      <div class="process-connector"></div>
      <div class="process-step">
        <div class="step-number">1</div>
        <div class="step-title">输入信息</div>
        <div class="step-desc">输入证书ID或哈希值</div>
      </div>
      <div class="process-step">
        <div class="step-number">2</div>
        <div class="step-title">发起验证</div>
        <div class="step-desc">在区块链上查询证书状态</div>
      </div>
      <div class="process-step">
        <div class="step-number">3</div>
        <div class="step-title">验证结果</div>
        <div class="step-desc">显示证书真实性和有效性结果</div>
          </div>
        </div>
        
    <el-card class="main-card">
      <!-- 添加光晕效果 -->
      <div class="glow-effect"></div>
      
      <template #header>
        <div class="card-header">
          <div class="title-section">
            <div class="icon-container">
              <i class="el-icon-check floating-icon"></i>
      </div>
            <span class="page-title">证书验证</span>
        </div>
        </div>
      </template>
      
      <div class="welcome-info">
        <div class="welcome-icon">
          <i class="el-icon-info"></i>
        </div>
        <div class="welcome-text">
          <h3>欢迎使用学信链证书验证系统</h3>
          <p>您可以通过以下方式验证证书的真实性：</p>
          <ol>
            <li>输入证书ID进行验证</li>
            <li>输入证书哈希值进行验证</li>
          </ol>
          <p>两项至少填写一项即可进行验证。验证结果将显示证书的有效性和区块链状态。</p>
        </div>
      </div>

      <el-form :model="form" label-width="120px" class="verify-form">
        <el-form-item label="证书ID">
          <el-input 
            v-model="form.certificateId" 
            placeholder="请输入要验证的证书ID"
            prefix-icon="el-icon-key"
            class="form-input"
          />
        </el-form-item>
        <el-form-item label="证书哈希">
          <el-input 
            v-model="form.hash" 
            placeholder="请输入证书哈希值"
            prefix-icon="el-icon-lock"
            class="form-input"
          />
        </el-form-item>
        <el-form-item>
          <el-button 
            type="primary" 
            @click="handleVerify" 
            :loading="loading"
            class="verify-button magical-btn"
          >
            <div class="btn-bg-effect"></div>
            <i class="el-icon-search"></i>
            验证证书
          </el-button>
        </el-form-item>
      </el-form>

      <div v-if="verificationResult !== null" class="verification-result">
        <div class="result-card" :class="{'success': verificationResult, 'error': !verificationResult}">
          <template v-if="verificationResult">
          <div class="success-animation">
            <div class="checkmark-circle">
              <div class="checkmark-circle-bg"></div>
              <div class="checkmark-stem"></div>
              <div class="checkmark-kick"></div>
              </div>
              <div class="sparkles">
                <div class="sparkle s1"></div>
                <div class="sparkle s2"></div>
                <div class="sparkle s3"></div>
                <div class="sparkle s4"></div>
                <div class="sparkle s5"></div>
                <div class="sparkle s6"></div>
              </div>
            </div>
          </template>
          <template v-else>
            <div class="error-animation">
              <div class="error-circle">
                <div class="error-circle-bg"></div>
                <div class="error-x-left"></div>
                <div class="error-x-right"></div>
          </div>
              <div class="error-ripple"></div>
            </div>
          </template>
          <div class="result-content">
            <h3 v-if="verificationResult" class="success-title">
              <span class="text-gradient">证书验证通过</span>
              <div class="badge-verified">
                <i class="el-icon-check"></i>
                区块链验证
            </div>
            </h3>
            <h3 v-else class="error-title">
              <span class="error-text-gradient">证书验证失败</span>
              <div class="badge-invalid">
                <i class="el-icon-warning"></i>
                验证不通过
          </div>
            </h3>
            <p v-if="verificationResult" class="success-description">
              该证书是<span class="highlight">有效的</span>，已在区块链上确认
              <span class="tech-badge">
                <i class="el-icon-link"></i>
                已上链
              </span>
            </p>
            <div v-else class="error-container">
              <p class="error-description">
                该证书<span class="error-highlight">无效或已被撤销</span>，可能的原因：
              </p>
              <ul class="error-reasons">
                <li><i class="el-icon-close"></i> 证书ID或哈希值不正确</li>
                <li><i class="el-icon-close"></i> 证书已被撤销</li>
                <li><i class="el-icon-close"></i> 证书尚未在区块链上确认</li>
              </ul>
              <p class="retry-tip">请检查输入信息后重试</p>
            </div>
          </div>
        </div>
          </div>
    </el-card>

    <!-- 添加区块链状态提示 -->
    <div class="status-notification">
      <status-notification status="online" message="学信链网络连接正常"></status-notification>
    </div>
  </div>
</template>

<script>
import { ref, onMounted } from 'vue'
import { useStore } from 'vuex'
import { ElMessage } from 'element-plus'
import { StatusNotification } from '@/components/GlobalComponents.vue'
import LogService from '@/store/logService'

export default {
  name: 'VerifyPage',
  components: {
    StatusNotification
  },
  setup() {
    const store = useStore()
    const form = ref({
      certificateId: '',
      hash: ''
    })
    const verificationResult = ref(null)
    const loading = ref(false)

    const handleVerify = async () => {
      if (!form.value.certificateId && !form.value.hash) {
        ElMessage.warning('请至少输入证书ID或证书哈希进行验证');
        return;
      }
      
      try {
        loading.value = true;
        verificationResult.value = null; // 先重置结果
        
        // 记录验证开始的操作日志
        LogService.logCertificateOperation('开始验证证书', {
          certificateId: form.value.certificateId || '未提供',
          hash: form.value.hash || '未提供'
        });
        
        // 为避免页面卡顿，使用setTimeout
        setTimeout(async () => {
          try {
            // 调用store的验证方法
            const result = await store.dispatch('verifyCertificate', {
              certificateId: form.value.certificateId,
              hash: form.value.hash
            });
            
            // 使用ref保存结果，而非直接修改store状态
            verificationResult.value = result;
            
            if (result) {
              ElMessage.success('证书验证成功');
              // 记录验证成功的操作日志
              LogService.logCertificateOperation('证书验证成功', {
                certificateId: form.value.certificateId || '未提供',
                hash: form.value.hash || '未提供',
                result: '有效'
              });
        } else {
              ElMessage.error('证书验证失败');
              // 记录验证失败的操作日志
              LogService.logCertificateOperation('证书验证失败', {
                certificateId: form.value.certificateId || '未提供',
                hash: form.value.hash || '未提供',
                result: '无效'
              }, 'error');
            }
          } catch (error) {
            console.error('验证证书处理异常:', error);
            ElMessage.error('验证失败：' + (error.message || '未知错误'));
            // 设置结果为false（验证失败）
            verificationResult.value = false;
            
            // 记录验证异常的操作日志
            LogService.logCertificateOperation('证书验证出错', {
              certificateId: form.value.certificateId || '未提供',
              hash: form.value.hash || '未提供'
            }, 'error', error.message || '未知错误');
          } finally {
            loading.value = false;
          }
        }, 1000);
      } catch (error) {
        console.error('验证准备异常:', error);
        loading.value = false;
        ElMessage.error('验证失败：' + (error.message || '未知错误'));
        verificationResult.value = false;
        
        // 记录验证准备异常的操作日志
        LogService.logCertificateOperation('证书验证准备失败', {
          certificateId: form.value.certificateId || '未提供',
          hash: form.value.hash || '未提供'
        }, 'error', error.message || '未知错误');
      }
    }

    // 组件挂载时添加访问日志
    onMounted(() => {
      LogService.logSystemOperation('访问证书验证页面');
    });

    return {
      form,
      handleVerify,
      verificationResult,
      loading
    }
  }
}
</script>

<style scoped>
.verify-page {
  max-width: 1000px;
  margin: 30px auto;
  padding: 0 20px;
  position: relative;
  overflow: hidden;
}

/* 增强粒子背景效果 */
.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: var(--size);
  height: var(--size);
  background: radial-gradient(circle, rgba(97, 73, 205, 0.8) 0%, rgba(97, 73, 205, 0) 70%);
  border-radius: 50%;
  top: calc(var(--position) - 50px);
  left: calc(var(--position) - 50px);
  animation: float var(--duration) ease-in-out var(--delay) infinite;
  opacity: 0.4;
  filter: blur(8px);
}

.particle:nth-child(even) {
  background: radial-gradient(circle, rgba(52, 179, 241, 0.8) 0%, rgba(52, 179, 241, 0) 70%);
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0.2;
  }
  25% {
    transform: translateY(-100px) translateX(50px) scale(1.2);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-30px) translateX(100px) scale(0.8);
    opacity: 0.6;
  }
  75% {
    transform: translateY(-70px) translateX(30px) scale(1.1);
    opacity: 0.4;
  }
}

/* 增强页面标题样式 */
.page-title-section {
  text-align: center;
  margin-bottom: 30px;
  position: relative;
  padding: 20px 0;
}

.magical-title {
  font-size: 36px;
  font-weight: 700;
  color: transparent;
  background: linear-gradient(45deg, #34b3f1, #6149cd, #6149cd, #34b3f1);
  background-size: 300% 300%;
  background-clip: text;
  -webkit-background-clip: text;
  animation: gradientText 6s ease infinite;
  position: relative;
  display: inline-block;
  margin: 0;
  letter-spacing: 2px;
  text-shadow: 0 10px 20px rgba(97, 73, 205, 0.15);
}

@keyframes gradientText {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.magical-underline {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 3px;
  background: linear-gradient(90deg, rgba(97,73,205,0) 0%, rgba(97,73,205,1) 50%, rgba(97,73,205,0) 100%);
  box-shadow: 0 4px 8px rgba(97, 73, 205, 0.3);
}

/* 验证流程指引 */
.verify-process-guide {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(52, 179, 241, 0.05);
  border-radius: 12px;
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.process-step {
  text-align: center;
  position: relative;
  flex: 1;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #34b3f1, #6149cd);
  color: white;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  box-shadow: 0 4px 10px rgba(97, 73, 205, 0.3);
  font-size: 18px;
}

.step-title {
  font-weight: 600;
  color: #303133;
  margin-bottom: 8px;
  font-size: 16px;
}

.step-desc {
  font-size: 14px;
  color: #606266;
}

.process-connector {
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, #34b3f1, #6149cd);
  z-index: 0;
}

/* 增强卡片样式 */
.main-card {
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
  overflow: hidden;
  border: none;
  position: relative;
  transition: all 0.5s;
  margin-bottom: 30px;
}

.main-card:hover {
  box-shadow: 0 15px 50px rgba(52, 179, 241, 0.25);
  transform: translateY(-5px);
}

.glow-effect {
  position: absolute;
  top: -100px;
  left: -100px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(97,73,205,0.3) 0%, rgba(97,73,205,0) 70%);
  border-radius: 50%;
  filter: blur(20px);
  animation: moveGlow 10s infinite alternate ease-in-out;
  z-index: 0;
  pointer-events: none;
}

@keyframes moveGlow {
  0% {
    top: -100px;
    left: -100px;
  }
  25% {
    top: 30%;
    left: 80%;
  }
  50% {
    top: 70%;
    left: 20%;
  }
  75% {
    top: 10%;
    left: 50%;
  }
  100% {
    top: 50%;
    left: 80%;
  }
}

/* 欢迎区样式增强 */
.welcome-info {
  display: flex;
  background: linear-gradient(145deg, rgba(52, 179, 241, 0.1), rgba(97, 73, 205, 0.05));
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 30px;
  border-left: 4px solid #409EFF;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.welcome-info::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(97, 73, 205, 0.1) 0%, rgba(97, 73, 205, 0) 70%);
  border-radius: 50%;
  z-index: 0;
}

.welcome-icon {
  font-size: 24px;
  color: #409EFF;
  margin-right: 20px;
  background: rgba(64, 158, 255, 0.1);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(64, 158, 255, 0.2);
}

.welcome-text h3 {
  color: #303133;
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 18px;
}

.welcome-text p {
  color: #606266;
  line-height: 1.6;
  margin-bottom: 10px;
}

.welcome-text ol {
  margin: 15px 0;
  padding-left: 20px;
}

.welcome-text li {
  margin-bottom: 8px;
  color: #606266;
}

/* 增强表单样式 */
.verify-form {
  padding: 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
}

:deep(.el-form-item__label) {
  font-weight: 500;
  color: #303133;
}

.form-input {
  width: 100%;
}

:deep(.el-input__inner) {
  border-radius: 8px;
  padding: 12px 15px;
  height: 50px;
  font-size: 15px;
  transition: all 0.3s;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #dcdfe6;
}

:deep(.el-input__inner:focus) {
  border-color: #6149cd;
  box-shadow: 0 0 0 2px rgba(97, 73, 205, 0.2);
}

:deep(.el-input__prefix) {
  left: 12px;
}

:deep(.el-input__prefix i) {
  font-size: 18px;
  color: #6149cd;
}

/* 增强验证按钮样式 */
.verify-button {
  width: 100%;
  height: 50px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 1px;
  border-radius: 8px;
  padding: 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #34b3f1, #6149cd);
  border: none;
  box-shadow: 0 5px 15px rgba(97, 73, 205, 0.3);
  transition: all 0.3s;
}

.verify-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(97, 73, 205, 0.4);
  background: linear-gradient(135deg, #6149cd, #34b3f1);
}

.verify-button i {
  margin-right: 8px;
  font-size: 18px;
}

.btn-bg-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #34b3f1, #6149cd, #6149cd, #34b3f1);
  background-size: 300% 300%;
  animation: gradientBg 3s ease infinite;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
}

.magical-btn:hover .btn-bg-effect {
  opacity: 0.2;
}

@keyframes gradientBg {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 增强验证结果样式 */
.verification-result {
  margin-top: 20px;
}

.result-card {
  display: flex;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  transition: all 0.5s;
  position: relative;
  overflow: hidden;
  align-items: center;
}

.result-card.success {
  background: linear-gradient(145deg, rgba(103, 194, 58, 0.1), rgba(103, 194, 58, 0.05));
  border-left: 5px solid #67c23a;
}

.result-card.error {
  background: linear-gradient(145deg, rgba(245, 108, 108, 0.1), rgba(245, 108, 108, 0.05));
  border-left: 5px solid #f56c6c;
}

.result-card:hover {
  transform: translateY(-5px);
}

.result-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  z-index: 0;
}

.result-card.success::after {
  background: radial-gradient(circle, rgba(103, 194, 58, 0.1) 0%, rgba(103, 194, 58, 0) 70%);
}

.result-card.error::after {
  background: radial-gradient(circle, rgba(245, 108, 108, 0.1) 0%, rgba(245, 108, 108, 0) 70%);
}

.result-content {
  flex: 1;
  padding-left: 20px;
}

.success-title, .error-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 0;
  margin-bottom: 15px;
}

.text-gradient {
  background: linear-gradient(45deg, #67c23a, #85ce61, #67c23a);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-text 3s linear infinite;
  font-size: 22px;
}

@keyframes gradient-text {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.badge-verified {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(to right, #67c23a, #85ce61);
  color: white;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 500;
  box-shadow: 0 3px 10px rgba(103, 194, 58, 0.2);
  animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.badge-verified i {
  margin-right: 5px;
  font-size: 13px;
}

.success-description {
  color: #606266;
  font-size: 15px;
  line-height: 1.6;
}

.highlight {
  color: #67c23a;
  font-weight: 700;
  position: relative;
}

.highlight::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, #67c23a, transparent);
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(52, 179, 241, 0.1);
  color: #34b3f1;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  margin-left: 10px;
}

.tech-badge i {
  margin-right: 3px;
  font-size: 12px;
}

/* 状态提示样式 */
.status-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

/* 更多现有样式... */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.title-section {
  display: flex;
  align-items: center;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: #303133;
}

.icon-container {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #34b3f1, #6149cd);
  border-radius: 50%;
  margin-right: 10px;
  position: relative;
  overflow: hidden;
}

.icon-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.8), transparent);
  transform: rotate(45deg);
  animation: shimmer 3s infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

.floating-icon {
  animation: floatingIcon 3s ease-in-out infinite;
  color: white;
  font-size: 20px;
}

@keyframes floatingIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* 验证结果样式 */
.verification-result {
  margin-top: 30px;
  padding: 0 20px;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  background-color: white;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 100%;
}

.result-card.success {
  box-shadow: 0 15px 40px rgba(103, 194, 58, 0.15);
  border: 1px solid rgba(103, 194, 58, 0.1);
  transform: translateY(-5px);
}

.result-card.success::before {
  background: linear-gradient(to bottom, #67c23a, #95eb63);
}

.result-card.error {
  box-shadow: 0 15px 40px rgba(245, 108, 108, 0.15);
  border: 1px solid rgba(245, 108, 108, 0.1);
}

.result-card.error::before {
  background: linear-gradient(to bottom, #f56c6c, #ff9b9b);
}

.result-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}

.result-card.success .result-icon {
  background-color: rgba(103, 194, 58, 0.1);
  color: #67c23a;
}

.result-card.error .result-icon {
  background-color: rgba(245, 108, 108, 0.1);
  color: #f56c6c;
}

.result-content {
  flex: 1;
}

.result-content h3 {
  margin: 0 0 5px 0;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-content p {
  margin: 10px 0 0 0;
  color: #606266;
  font-size: 16px;
  line-height: 1.6;
}

.result-card.success .result-content h3 {
  color: #67c23a;
}

.result-card.error .result-content h3 {
  color: #f56c6c;
}

/* 炫酷成功动画 */
.success-animation {
  position: relative;
  width: 80px;
  height: 80px;
}

.checkmark-circle {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

.checkmark-circle-bg {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(145deg, #67c23a, #95eb63);
  box-shadow: 0 10px 20px rgba(103, 194, 58, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(103, 194, 58, 0.5);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 15px rgba(103, 194, 58, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(103, 194, 58, 0);
  }
}

.checkmark-stem {
  position: absolute;
  width: 5px;
  height: 25px;
  background-color: white;
  left: 38px;
  top: 28px;
  border-radius: 3px;
  transform: rotate(45deg);
  animation: checkmark-stem-anim 0.5s ease;
}

.checkmark-kick {
  position: absolute;
  width: 15px;
  height: 5px;
  background-color: white;
  left: 26px;
  top: 45px;
  border-radius: 3px;
  transform: rotate(45deg);
  animation: checkmark-kick-anim 0.5s ease;
}

@keyframes checkmark-stem-anim {
  0% {
    height: 0;
    opacity: 0;
  }
  40% {
    height: 0;
    opacity: 0;
  }
  100% {
    height: 25px;
    opacity: 1;
  }
}

@keyframes checkmark-kick-anim {
  0% {
    width: 0;
    opacity: 0;
  }
  40% {
    width: 0;
    opacity: 0;
  }
  100% {
    width: 15px;
    opacity: 1;
  }
}

/* 闪烁效果 */
.sparkles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.sparkle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  opacity: 0;
}

.sparkle.s1 {
  top: 10%;
  left: 80%;
  animation: sparkle-anim 1.5s ease infinite 0.2s;
}

.sparkle.s2 {
  top: 80%;
  left: 10%;
  animation: sparkle-anim 1.5s ease infinite 0.4s;
}

.sparkle.s3 {
  top: 50%;
  left: 90%;
  animation: sparkle-anim 1.5s ease infinite 0.6s;
}

.sparkle.s4 {
  top: 90%;
  left: 50%;
  animation: sparkle-anim 1.5s ease infinite 0.8s;
}

.sparkle.s5 {
  top: 10%;
  left: 10%;
  animation: sparkle-anim 1.5s ease infinite 1.0s;
}

.sparkle.s6 {
  top: 40%;
  left: 20%;
  animation: sparkle-anim 1.5s ease infinite 1.2s;
}

@keyframes sparkle-anim {
  0% {
    transform: scale(0);
  opacity: 0;
  }
  20% {
    transform: scale(1.2);
    opacity: 0.8;
  }
  40% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  60% {
    transform: scale(1.5);
    opacity: 0.3;
  }
  80% {
    transform: scale(0.5);
    opacity: 0.1;
  }
  100% {
    transform: scale(0);
    opacity: 0;
  }
}

.text-gradient {
  background: linear-gradient(45deg, #34b3f1, #6149cd, #67c23a);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-text 3s linear infinite;
}

@keyframes gradient-text {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.badge-verified {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(to right, #67c23a, #34b3f1);
  color: white;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
  box-shadow: 0 3px 10px rgba(103, 194, 58, 0.2);
  animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.badge-verified i {
  margin-right: 4px;
  font-size: 12px;
}

.success-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.success-description {
  position: relative;
  color: #606266;
}

.highlight {
  color: #67c23a;
  font-weight: 700;
  position: relative;
}

.highlight::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, #67c23a, transparent);
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  background-color: #f5f7fa;
  color: #606266;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-left: 8px;
  border: 1px solid #e4e7ed;
}

.tech-badge i {
  font-size: 12px;
  margin-right: 4px;
  color: #67c23a;
}

/* 失败动画效果 */
.error-animation {
  position: relative;
  width: 80px;
  height: 80px;
}

.error-circle {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

.error-circle-bg {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f56c6c, #ff9b9b);
  box-shadow: 0 10px 20px rgba(245, 108, 108, 0.3);
  animation: error-pulse 2s infinite;
}

@keyframes error-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(245, 108, 108, 0.5);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 15px rgba(245, 108, 108, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(245, 108, 108, 0);
  }
}

.error-x-left {
  position: absolute;
  width: 5px;
  height: 30px;
  background-color: white;
  left: 38px;
  top: 25px;
  border-radius: 3px;
  transform: rotate(45deg);
  animation: error-x-anim 0.5s ease;
}

.error-x-right {
  position: absolute;
  width: 5px;
  height: 30px;
  background-color: white;
  left: 38px;
  top: 25px;
  border-radius: 3px;
  transform: rotate(-45deg);
  animation: error-x-anim 0.5s ease;
}

@keyframes error-x-anim {
  0% {
    height: 0;
    opacity: 0;
  }
  40% {
    height: 0;
    opacity: 0;
  }
  100% {
    height: 30px;
    opacity: 1;
  }
}

.error-ripple {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid rgba(245, 108, 108, 0.5);
  opacity: 0;
  animation: error-ripple-anim 2s ease-out infinite;
}

@keyframes error-ripple-anim {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.error-text-gradient {
  background: linear-gradient(45deg, #f56c6c, #ff9b9b, #ff7875);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: error-gradient-text 3s linear infinite;
}

@keyframes error-gradient-text {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.badge-invalid {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(to right, #f56c6c, #ff9b9b);
  color: white;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
  box-shadow: 0 3px 10px rgba(245, 108, 108, 0.2);
  animation: badge-error-pulse 2s infinite;
}

@keyframes badge-error-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.badge-invalid i {
  margin-right: 4px;
  font-size: 12px;
}

.error-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.error-description {
  position: relative;
  color: #606266;
}

.error-highlight {
  color: #f56c6c;
  font-weight: 700;
  position: relative;
}

.error-highlight::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, #f56c6c, transparent);
}

.error-reasons {
  margin: 10px 0;
  padding-left: 20px;
  list-style: none;
}

.error-reasons li {
  margin-bottom: 5px;
  font-size: 14px;
  display: flex;
  align-items: center;
}

.error-reasons li i {
  color: #f56c6c;
  margin-right: 8px;
  font-size: 12px;
}

.retry-tip {
  display: block;
  margin-top: 10px;
  font-weight: 500;
  font-style: italic;
  color: #606266;
}
</style> 